package com.example.demo.utils;

import java.util.UUID;

public class UUIDUtil {

    public static String getUUID() {
        UUID uuid = UUID.randomUUID();
        String str = uuid.toString();
        // 去掉"-"符号
        String id = str.replace("-", "").substring(0,16);
        return id;
    }


    public static void main(String[] args) {
        System.out.println(getUUID());
    }
}
